import java.util.ArrayList;
import java.util.List;
public class Main {
    public static void main(String[] args) {

        List<String> hobbies = new ArrayList<>();
        hobbies.add("Reading");
        Person01 person01 = new Person01(18,"明志",hobbies);
        //尝试修改原始的 hobbies
        hobbies.add("Cooking");
        System.out.println("修改后 hobbies："+ hobbies);
        //不可变类的 hobbies 没有被修改
        System.out.println("不可变类的 hobbies："+ person01.getHobbies());
        //尝试修改
        person01.getHobbies().add("明志");
    }
}
